package com.cn.integration.business.invoicecenter.service.impl;

import com.cn.integration.business.invoicecenter.dto.InvoiceConfDto;
import com.cn.integration.business.invoicecenter.service.InvoiceConfService;
import com.cn.integration.business.invoicecenter.vo.InvoiceConfVo;
import com.cn.integration.repository.InvoiceConfMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class InvoiceConfServiceImpl implements InvoiceConfService {

    @Resource
    private InvoiceConfMapper invoiceConfMapper;

    @Override
    public PageInfo<InvoiceConfVo> queryInvoiceConfPage(InvoiceConfDto dto) {
        PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
        List<InvoiceConfVo> list = invoiceConfMapper.queryList(dto);
        PageInfo<InvoiceConfVo> page = new PageInfo<>(list);
        return page;
    }

    @Override
    public List<InvoiceConfVo> queryInvoiceConfList(InvoiceConfDto dto) {
        return invoiceConfMapper.queryList(dto);
    }
}
